package Frame.screen;

import FCRendering.FCRConstants;
import FCRendering.FCRMaster;
import FCRendering.ImageUtil;

import java.awt.*;

import static FCRendering.FCRMaster.charLib;
import static FCRendering.FCRMaster.fcv;

//剧情对话的
public class PlotNpcSayScreen extends IScreen{
    Font font2;
    @Override
    public void dispatchPaintComponent(Graphics g, FCRMaster fcrMaster) {
        // 渲染剧情对话
        if (fcv.isPlotNpc1SayClick()) {
            if (fcrMaster.getPlotnpc1sayname() != null) {
                g.drawImage(ImageUtil.getImage("gamesayframe"), (int) (532 * fcv.getProportion()),
                        (int) (732 * fcv.getProportion()), (int) (856 * fcv.getProportion()), (int) (192 * fcv.getProportion()), this);
                g.drawImage(charLib.getCharacterOfName(fcrMaster.getPlotnpc1sayname()).getActionImage(0, 0, false),
                        (int) (546 * fcv.getProportion()), (int) (746 * fcv.getProportion()), (int) (164 * fcv.getProportion()),
                        (int) (164 * fcv.getProportion()), this);
                g.setColor(Color.white);
                g.setFont(font2);
                g.drawString(fcrMaster.getLangLib().getNameOfId(fcrMaster.getPlotnpc1sayid()), (int) (720 * fcv.getProportion()),
                        (int) (780 * fcv.getProportion()));
            }
        }
    }

    @Override
    protected void setBounds() {
        font2 = new Font(FCRConstants.FONT_ELEGANT_BLACK, 0, (int) (22 * fcv.getProportion()));
    }
}
